package me.vudu.Conflict.Runnables;

import java.util.logging.Level;

import me.vudu.Conflict.Mobs.VuduZombie;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Villager;
import org.bukkit.entity.Zombie;

import de.ntcomputer.minecraft.controllablemobs.api.ControllableMob;
import de.ntcomputer.minecraft.controllablemobs.api.ControllableMobs;
import de.ntcomputer.minecraft.controllablemobs.api.aibehaviors.AITargetNearest;
import de.ntcomputer.minecraft.controllablemobs.api.aibehaviors.EntityFilter;

/**
 * berechnet die Position der Bases relativ zur Blickrichtung und setzt darauf basierend die Pfeile beim Spieler
 * @author vwendel
 *
 */
public class MobTargetRunnable implements Runnable{
		
	@Override
	public void run() {
		

//		World w = Bukkit.getServer().getWorlds().get(0);
//		VuduZombie z = new VuduZombie(new Location(w,140,65, 100));
//		z.moveTo(new Location(w,130,65, 100));
//		
//		Entity e =  w.spawnEntity(new Location(w,150,65, 100), EntityType.ZOMBIE);
//		Zombie z = (Zombie)e;
//		ControllableMob<Zombie> cz = ControllableMobs.assign(z, false);
//			
//		//cz.getAI().clearAIBehaviors();
//		
//		
////		EntityFilter ef = new EntityFilter() {
////			
////			@Override
////			public boolean isEntityValid(Entity e) {
////				if (e.getType() == EntityType.VILLAGER){
////					return true;
////				}
////				return false;
////			}
////		};
//			
//		//AITargetNearest b = new AITargetNearest(1, 100, false, 0, ef);
//		//cz.getAI().addAIBehavior(b);
//		
//		cz.getActions().moveTo(new Location(w,175,65, 100), true);
//		cz.getActions().moveTo(new Location(w,175,65, 120), true);
//		
//		
//		
//		cz.getActions().callback(new Runnable() {
//			
//			@Override
//			public void run() {
//				Bukkit.getLogger().log(Level.INFO, "Done");
//				
//			}
//		});

			
	
	}
	

}
